/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.wh.transaction.posupplierdetail;

import com.buanalintas.bynga.Action;
import com.buanalintas.bynga.Field;
import com.buanalintas.bynga.Page;
import com.ronsicecream.pos.entities.PosTransactionHoPurchaseOrderSupplierDetail;

/**
 *
 * @author user
 */
public class PurchaseOrderSupplierDetail extends Page {

    private Field purchaseOrderDetailId;
    private Field purchaseOrderDetailQuantity;
    private Field purchaseOrderDetailSent;
    private Field purchaseOrderDetailUnsent;
    private Field purchaseOrderDetailPrice;
    private Field purchaseOrderDetailDescription;
//    private Field purchaseOrderDetailSatuanId;
    private Field purchaseOrderDetailItemId;
    private Field purchaseOrderDetailPurchaseOrderId;

    public PurchaseOrderSupplierDetail() {
        super();

        setTheClass(PosTransactionHoPurchaseOrderSupplierDetail.class);




        purchaseOrderDetailId = new Field();
        purchaseOrderDetailId.setName("purchaseOrderDetailId");
        purchaseOrderDetailId.setCaption("id");
        //purchaseOrderDetailId.setInfo("purchase order detail id");
        purchaseOrderDetailId.setListProperties(" align=\"left\" width=\"1%\" nowrap");
        purchaseOrderDetailId.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailId);

        purchaseOrderDetailQuantity = new Field();
        purchaseOrderDetailQuantity.setName("purchaseOrderDetailQuantity");
        purchaseOrderDetailQuantity.setCaption("quantity");
        purchaseOrderDetailQuantity.setRequired(true);
        purchaseOrderDetailQuantity.setDefaultValue(0);
        purchaseOrderDetailQuantity.setListProperties(" align=\"left\" width=\"5%\" nowrap");
        purchaseOrderDetailQuantity.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailQuantity);

        purchaseOrderDetailSent = new Field();
        purchaseOrderDetailSent.setName("purchaseOrderDetailSent");
        purchaseOrderDetailSent.setCaption("sent");
        //purchaseOrderDetailSent.setInfo("purchase order detail sent");
        purchaseOrderDetailSent.setListProperties(" align=\"left\" width=\"5%\" nowrap");
        purchaseOrderDetailSent.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailSent);

        purchaseOrderDetailUnsent = new Field();
        purchaseOrderDetailUnsent.setName("purchaseOrderDetailUnsent");
        purchaseOrderDetailUnsent.setCaption("unsent");
        //purchaseOrderDetailUnsent.setInfo("purchase order detail unsent");
        purchaseOrderDetailUnsent.setListProperties(" align=\"left\" width=\"5%\" nowrap");
        purchaseOrderDetailUnsent.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailUnsent);

        purchaseOrderDetailPrice = new Field();
        purchaseOrderDetailPrice.setName("purchaseOrderDetailPrice");
        purchaseOrderDetailPrice.setCaption("price");
        purchaseOrderDetailPrice.setRequired(true);
        purchaseOrderDetailPrice.setDefaultValue(0);
        purchaseOrderDetailPrice.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        purchaseOrderDetailPrice.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailPrice);

        purchaseOrderDetailDescription = new Field();
        purchaseOrderDetailDescription.setName("purchaseOrderDetailDescription");
        purchaseOrderDetailDescription.setCaption("description");
        //purchaseOrderDetailDescription.setInfo("purchase order detail description");
        purchaseOrderDetailDescription.setListProperties(" align=\"left\" width=\"30%\" nowrap");
        purchaseOrderDetailDescription.setInputProperties(" cols=\"50\" rows=\"5\"");
        purchaseOrderDetailDescription.setInputType(Field.INPUT_TEXT_AREA);
        purchaseOrderDetailDescription.setInputCase(Field.CASE_UPPER);
        getFields().add(purchaseOrderDetailDescription);

//        purchaseOrderDetailSatuanId = new Field();
//        purchaseOrderDetailSatuanId.setName("purchaseOrderDetailSatuanId");
//        purchaseOrderDetailSatuanId.setCaption("satuan");
//        purchaseOrderDetailSatuanId.setRequired(true);
//        purchaseOrderDetailSatuanId.setListProperties(" align=\"left\" width=\"5%\" nowrap");
//        purchaseOrderDetailSatuanId.setInputProperties(" size=\"20\"");        
//        getFields().add(purchaseOrderDetailSatuanId);

        purchaseOrderDetailItemId = new Field();
        purchaseOrderDetailItemId.setName("purchaseOrderDetailItemId");
        purchaseOrderDetailItemId.setCaption("item");
        purchaseOrderDetailItemId.setRequired(true);
        purchaseOrderDetailItemId.setSelectorCondition(" t.itemTypeId.typeId=6");
        purchaseOrderDetailItemId.getSelectorColumns().add(new String[]{"itemName", " Nama", "width=\"40%\""});
        purchaseOrderDetailItemId.getSelectorColumns().add(new String[]{"itemCode", " Code", "width=\"10%\" nowrap"});
        purchaseOrderDetailItemId.getSelectorColumns().add(new String[]{"itemTypeId", " Type", "width=\"20%\""});
        purchaseOrderDetailItemId.getSelectorColumns().add(new String[]{"itemRasaId", " Rasa", "width=\"20%\""});
        purchaseOrderDetailItemId.getSelectorColumns().add(new String[]{"itemSatuanId", " Satuan", "width=\"20%\""});
        purchaseOrderDetailItemId.getSelectorColumns().add(new String[]{"itemMinimum", " Minimum", "width=\"20%\""});
        purchaseOrderDetailItemId.setSelectorOrder("t.itemName");
        purchaseOrderDetailItemId.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        purchaseOrderDetailItemId.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailItemId);

        purchaseOrderDetailPurchaseOrderId = new Field();
        purchaseOrderDetailPurchaseOrderId.setName("purchaseOrderDetailPurchaseOrderId");
        purchaseOrderDetailPurchaseOrderId.setCaption(" purchase order ");
        //posTransactionPurchaseOrderSupplier.setInfo("pos transaction purchase order supplier");
        purchaseOrderDetailPurchaseOrderId.setListProperties(" align=\"left\" width=\"15%\" nowrap");
        purchaseOrderDetailPurchaseOrderId.setInputProperties(" size=\"20\"");
        getFields().add(purchaseOrderDetailPurchaseOrderId);

        getActions().add(Action.TRANS_DETAIL_LIST);
        getActions().add(Action.TRANS_DETAIL_ADD);
        getActions().add(Action.TRANS_DETAIL_EDIT);

        fillFields();

        getFieldsAdd().clear();
        getFieldsAdd().add(purchaseOrderDetailItemId);
        getFieldsAdd().add(purchaseOrderDetailQuantity);
//        getFieldsAdd().add(purchaseOrderDetailSatuanId);
        getFieldsAdd().add(purchaseOrderDetailPrice);

        getFieldsEdit().clear();
        getFieldsEdit().add(purchaseOrderDetailItemId);
        getFieldsEdit().add(purchaseOrderDetailQuantity);
//        getFieldsEdit().add(purchaseOrderDetailSatuanId);
        getFieldsEdit().add(purchaseOrderDetailPrice);


        getFieldsList().clear();
        getFieldsList().add(purchaseOrderDetailItemId);
        getFieldsList().add(purchaseOrderDetailQuantity);
//        getFieldsList().add(purchaseOrderDetailSatuanId);
        getFieldsList().add(purchaseOrderDetailPrice);
        getFieldsList().add(purchaseOrderDetailSent);
        getFieldsList().add(purchaseOrderDetailUnsent);
    }
}
